<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    /*
     *@Description: 隐藏供应商门户首页已报名项目列表按钮
     *@Param: [request, response]
     *@return: void
     *@Author: Dusongsong
     *@Date: 2021/1/14
     */
    bb.writeLog( "------------------getHideYbmxmBtn_Ajax--------------------" );
    String lxmc = Util.null2String( request.getParameter( "lxmc" ) );//立项名称
    String tbrmc = Util.null2String( request.getParameter( "tbrmc" ) );//供应商
    bb.writeLog("lxmc="+lxmc+",tbrmc="+tbrmc);
    String zblx_table = bb.getPropValue( "srm_wf_table", "zblx_table" );
    String tbbzjjn_table = bb.getPropValue( "srm_wf_table", "tbbzjjn_table" );
    JSONObject jsonData = new JSONObject();
    String sql = "select xygmbs,tbbzj,lybzj from " + zblx_table + " where id ='" + lxmc + "'";
    rs.executeQuery( sql );
    rs.next();
    String str1 = "提问";
    String str2 = "";
    String str3 = "";
    int xygmbs = Util.getIntValue( rs.getString( "xygmbs" ) );//标书购买
    int tbbzj = Util.getIntValue( rs.getString( "tbbzj" ) );//投标保证金
    int lybzj = Util.getIntValue( rs.getString( "lybzj" ) );//履约保证金
    bb.writeLog("xygmbs="+xygmbs);
    bb.writeLog("tbbzj="+tbbzj);
    bb.writeLog("lybzj="+lybzj);
    if (tbbzj==1 && lybzj==1) {
        str2 = "";
    } else {
        String sql1 = "select t2.currentnodetype from " + tbbzjjn_table + " t1 " +
                "left join workflow_requestbase t2 on t1.requestid=t2.requestid where t1.zblx=? and t1.gysmc=?";
        rs1.executeQuery( sql1, lxmc, tbrmc );
        rs1.writeLog(sql1,String.join( ",",lxmc, tbrmc) );
        if (rs1.next()) {
            int currentnodetype = Util.getIntValue( rs1.getString( 1 ) );
            str2 = currentnodetype > 0 ? "" : "保证金缴纳";
        }else {
            str2 = "保证金缴纳";
        }
    }
    if (xygmbs==1) {
        str3 = "";
    } else {
        String sql2 = "select t2.currentnodetype from formtable_main_756 t1 " +
                "left join workflow_requestbase t2 on t1.requestid=t2.requestid where t1.zblx=? and t1.gysmc=?";
        rs2.executeQuery( sql2, lxmc, tbrmc );
        rs2.writeLog(sql2,String.join( ",",lxmc, tbrmc) );
        if (rs2.next()) {
            int currentnodetype = Util.getIntValue( rs2.getString( 1 ) );
            str3 = currentnodetype > 0 ? "" : "标书购买";
        }else {
            str3 = "标书购买";
        }
    }

    jsonData.put( "str1", str1 );
    jsonData.put( "str2", str2 );
    jsonData.put( "str3", str3 );
    out.print( jsonData.toJSONString() );
    bb.writeLog( "getHideYbmxmBtn_Ajax=" + jsonData.toJSONString() );
%>

